package com.ruicar.afs.cloud.parameter.commom.enums;

import lombok.Getter;

/**
 * @description: 车辆属性枚举
 * @author: sijun.yu
 * @date: 2020/5/13 19:01
 */
@Getter
public enum CarNature {

    NEW_CAR("01", "新车"),
    PLATE_CAR("02", "挂牌新车"),
    OLD_CAR("03", "二手车"),
    CA_OLD_CAR("04", "认证二手车"),
    TEST_CAR("05", "试乘试驾车");

    private final String index;
    private final String name;

    private CarNature(String index, String name) {
        this.index = index;
        this.name = name;
    }

    public static String getName(String index) {
        for (CarNature natureEnum : CarNature.values()) {
            if (natureEnum.getIndex().equals(index)) {
                return natureEnum.getName();
            }
        }
        return null;
    }

}
